#include <iostream>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    long long min, max, a;
    min = 100000000;
    max = 0;
    while(cin >> a)
    {
        if(a < min)
        {
            min = a;
        }
        if(a > max)
        {
            max = a;
        }
    }
    cout << min << "," << max;
}